package com.hopeedu.shop.admin.controller;/**
 * Create By xbyang as 2019/8/8
 */

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: hopeedu-shop
 * @description:
 * @author: xbyang
 * @create: 2019-08-08 15:58
 **/
@RefreshScope
@RestController
@RequestMapping(value = "/some")
public class SomeController {

    @Value("${myblog.name}")
    private String message;

    @Value("${server.port}")
    private String port;


    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public Object savePerson(@RequestBody String personName) {

        Map map = new HashMap();
        map.put("err", 200);
        map.put("data", "success");
        map.put("message", null);
        return map;
    }


    @RequestMapping(value = "/getSome")
    public String getSome(@RequestBody String name){
        return message + " " + port + " " + name;
    }
}
